<%--
  Created by IntelliJ IDEA.
  User: 22328
  Date: 2021/2/8
  Time: 15:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>前台页面头部</title>
</head>
<body>
<!--头部  开始-->
<div class="header_con">
    <div class="header">
        <div class="welcome fl">欢迎来到焕耀商城!</div>
        <div class="login_btn fl"><a href="./main" style="margin-left:30px"
                                     target="_blank">邂逅·好物</a></div>
        <div class="fr">
            <c:if test="${sessionScope.user!=null}">
                <div class="login_info fl" style="display: block">
                    欢迎您：<em>${sessionScope.user.userName}</em>
                    <a href="./login" class="zhuxiao">注销</a>
                </div>
                <div class="login_btn fl" style="display:none">
                    <a href="./login">登录</a>
                    <span>|</span>
                    <a href="./register">注册</a>
                </div>
                <div class="user_link fl">
                    <span>|</span>
                    <a href="./getPersonalHtml">用户中心</a>
                    <span>|</span>
                    <a href="./getCartHtml?userId=${sessionScope.user.id}">我的购物车</a>
                    <span>|</span>
                    <a href="./getOrderHtml?userId=${sessionScope.user.id}">我的订单</a>
                </div>
            </c:if>
            <c:if test="${sessionScope.user==null}">
                <div class="login_btn fl">
                    <a href="./login">登录</a>
                    <span>|</span>
                    <a href="./register">注册</a>
                </div>
                <div class="user_link fl">
                    <span>|</span>
                    <a href="./login">用户中心</a>
                    <span>|</span>
                    <a href="./login">我的购物车</a>
                    <span>|</span>
                    <a href="./login">我的订单</a>
                </div>
            </c:if>
        </div>
    </div>
</div>
<!--头部 结束-->
</body>
</html>
